<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./MainTemplate.xhtml">

            <ui:define name="title">
                Edit Information
            </ui:define>

            <ui:define name="head">
                
            </ui:define>

            <ui:define name="left">
                <h:form>
                    
                    <h1 class="title">Edit Information</h1>
                    <h4 style="text-align: justify">Please fill below form for change your information</h4>
                    <h:panelGrid columns="3" cellpadding="5" id="panel">
                        <h:outputLabel value="Driver's Name:" style="font-weight: bold;"/>
                        <p:inputText id="name" value="#{driverBean.name}" required="true" requiredMessage="Please insert your name!"/>
                        <p:message for="name"/>

                        <h:outputLabel value="Email:" style="font-weight: bold;"/>
                        <p:inputText id="email" value="#{accountBean.email}" required="true" requiredMessage="Please insert your email!"/>
                        <p:message for="email"/>

                        <h:outputLabel value="Password:" style="font-weight: bold;"/>
                        <p:password id="pwd" value="#{accountBean.password}" feedback="true" required="true" requiredMessage="Please insert your password" label="Password"/>
                        <p:message for="pwd"/>

                        <h:outputLabel value="Contact Person:" style="font-weight: bold;"/>
                        <p:inputText id="contact" value="#{driverBean.contactPerson}" required="true" requiredMessage="Please insert contact person!"/>
                        <p:message for="contact"/>

                        <h:outputLabel value="Address:" style="font-weight: bold;"/>
                        <p:inputText id="address" value="#{driverBean.address}" required="true" requiredMessage="Please insert address!"/>
                        <p:message for="address"/>

                        <h:outputLabel value="City" style="font-weight: bold;"/>
                        <p:inputText id="city" value="#{driverBean.city}" required="true" requiredMessage="Please insert city!"/>
                        <p:message for="city"/>

                        <h:outputLabel value="Mobile:" style="font-weight: bold;"/>
                        <p:inputText id="mobile" value="#{driverBean.mobile}" required="true" requiredMessage="Please insert mobile!"/>
                        <p:message for="mobile"/>

                        <h:outputLabel value="Telephone:" style="font-weight: bold;"/>
                        <p:inputText id="telephone" value="#{driverBean.telephone}" required="true" requiredMessage="Please insert telephone"/>
                        <p:message for="telephone"/>

                        <h:outputLabel value="Experience:" style="font-weight: bold;"/>
                        <p:inputText id="experience" value="#{driverBean.experience}" required="true" requiredMessage="Please insert your experiences!"/>
                        <p:message for="experience"/>

                        <h:outputLabel value="Description" style="font-weight: bold;"/>
                        <p:inputTextarea id="description" value="#{driverBean.description}"/>
                        <p:message for="description"/>

                    </h:panelGrid>
                    <p:messages autoUpdate="true" showSummary="true" showDetail="true" globalOnly="true"/>
                    <p:commandButton value="Save" actionListener="#{driversController.editDriver()}" update="panel"/>&nbsp;
                    <p:commandButton value="Reset" type="Reset"/>

                </h:form>
            </ui:define>

            <ui:define name="right">
                
            </ui:define>

        </ui:composition>

    </body>
</html>
